<!-- BEGIN CONTENT -->
	<div id="content">	    
	    <div class="box-out">
	    	<div class="box-in">
	    		<div class="box-head"><h1>Thông tin phản hồi</h1></div>
	    		<div class="box-content">
	    			<div class="notification error-box">
	    				<div class="messages">Error messages <div class="close"><img src="<?php echo STATIC_DOMAIN ?>skins/admin/images/icon/close.png" alt="close" /></div></div>
	    			</div><!-- end div .notification error -->
	    			<div class="notification success">
	    				<div class="messages">Successfull messages <div class="close"><img src="<?php echo STATIC_DOMAIN ?>skins/admin/images/icon/close.png" alt="close" /></div></div>
	    			</div><!-- end div .notification success -->
	    			<div class="notification warning">
	    				<div class="messages">Warning messages <div class="close"><img src="<?php echo STATIC_DOMAIN ?>skins/admin/images/icon/close.png" alt="close" /></div></div>
	    			</div><!-- end div .notification warning -->
	    			<div class="notification info">
	    				<div class="messages">info messages <div class="close"><img src="<?php echo STATIC_DOMAIN ?>skins/admin/images/icon/close.png" alt="close" /></div></div>
	    			</div><!-- end div .notification info -->	    			
	    			<div class="table">
	    				<form action="" method="post">
	    					<table>
	    						<thead>
	    							<tr>
	    								<td class="checkbox"><div><input type="checkbox" class="check_all" /></div></td>
	    								<td><div>Website</div></td>
	    								<td><div>Người liên hệ</div></td>	    								
	    								<td><div>Thông tin</div></td> 	
	    								<td><div>Actions</div></td>
	    							</tr>
	    						</thead>
	    						<tbody>
	    						<?php if($infos):?>
	    						<?php foreach($infos as $index => $info):?>
	    							<?php 
	    								$CI = & get_instance();
	    								$sub_content = $CI->mycommon->snippetwop($info['content'],100);	    								
	    							?>
	    							<tr <?php if($info['status'] == 2) echo "class='block-color'"?>>
	    								<td class="checkbox"><div class="<?php echo $info['status'] == 2 ? 'block-color' : 'even';?>" ><input type="checkbox" class="check_item" name="check_item[]" value="<?php echo $info['id']?>"/></div></td>
	    								<td><div class="<?php echo $info['status'] == 2 ? 'block-color' : 'even';?>"><a href="<?php echo $info['website']?>" target="_blank"><?php echo $info['website']?></a></div></td>
	    								<td>
	    									<div class="<?php echo $info['status'] == 2 ? 'block-color' : 'even';?>">
	    										<span><b><?php echo $info['name']?></b></span><br/>
	    										<span class="info-other"><i>*&nbsp&nbsp<?php echo $info['phone']?></i></span><br/>
	    										<span class="info-other"><i>*&nbsp&nbsp<?php echo $info['email']?></i></span>
	    									</div>
	    								</td>	    								
	    								<td><div class="<?php echo $info['status'] == 2 ? 'block-color' : 'even';?>"><a class="tooltip" href="#" title="<?php echo $info['content']?>"><?php echo $sub_content?></a></div></td>
	    								<td class="action">
		    								<div class="<?php echo $info['status'] == 2 ? 'block-color' : 'even';?>" id="<?php echo $info['id']?>">
		    									<?php if($info['status'] == 1):?>
		    									<a id="block" class="tooltip contact-action" title="edit this item">Block</a> -
		    									<?php endif;?> 		    									
		    									<a id="delete" class="tooltip contact-action" title="delete this item">Delete</a>
		    								</div>
	    								</td>	    								
	    							</tr>	    				
	    						<?php endforeach; ?>
	    						<?php endif;?>			
	    						</tbody>
	    					</table>
	    					<div class="actions">
	    						<select class="applyfield" name="applyfield">
	    							<option value="0">Choose</option>
	    							<option value="1"> Delete</option>
	    							<option value="2"> Block</option>
	    						</select>
	    						<input type="submit" class="apply" value="apply" />
	    					</div><!-- end div .actions -->
	    					<div class="pagination">
			                    <?php if($pagination != ''): ?>			                    
			                    <?php echo $pagination ?>
			                    <?php endif; ?>
			                </div>
			                <span id="current_page" style="display:none"><?php echo $cur_page?></span>
			                <!-- end div .pagination -->
	    				</form>
	    			</div><!-- end div .table -->
	    		</div><!-- end div .box-content -->
	    	</div><!-- end div .box-in -->
	    </div><!-- end div .box-out -->	    	    
	</div><!-- end div #content -->	
	<!-- END CONTENT -->
	<script type="text/javascript">
		$(document).ready(function(){
			$('.close').click(function(){
				$(this).parents('.notification').fadeOut(500);
			});
			$('.check_all').click(function () {
			    $(this).closest('table').find('input[type=checkbox]').prop('checked', this.checked);
			});				
			$('.contact-action').click(function(){
				var This = this;
				var r=false;
				ajaxData = {};			
				var type = $(this).attr('id');
				if(type == 'delete'){	
					ajaxData['status'] = 0;
					r=confirm("Bạn có chắc muốn xóa?");
				}					
				else{
					if(type == 'block'){
						ajaxData['status'] = 2;
						r=confirm("Bạn có chắc muốn block?");
					}
					else
						ajaxData['status'] = 1;	
				}
				ajaxData['id'] = $(this).parent().attr('id');
				if (r==true)
				{				
					var url = "<?php echo STATIC_DOMAIN?>admin/landing/update";						
					$.ajax({
					    url : url,                          
					    type: 'post',                   
					    dataType:'json',                   
					    data: ajaxData,
					    success : function(data) {  						    
					        //var respond = JSON.stringify(data);					        					        														    	            					    
					        if(data.error==""){						       						       
					        	$(This).parents('tr').css('background','#f2bba0');
					        	$(This).parents('tr').find('.even').css('background','#f2bba0');
								$('.success').show();
					        }
					        else
					        	$('.error-box').show();
					    }
					});
				}								
			})
		});
	</script>